//
//  CLReadMenu.h
//  CLBrowser
//
//  Created by 梁慧聪 on 2022/7/22.
//

#import <UIKit/UIKit.h>
#import "CLRMTopView.h"
#import "CLRMBottomView.h"
NS_ASSUME_NONNULL_BEGIN
@class CLReadMenu,CLReadController,CLReadContentView,CLRMSettingView;

@protocol CLReadMenuDelegate <NSObject>
  
@optional
    /// 菜单将要显示
- (void)readMenuWillDisplay:(CLReadMenu *)readMenu;
    
    /// 菜单完成显示
- (void)readMenuDidDisplay:(CLReadMenu *)readMenu;
    
    /// 菜单将要隐藏
- (void)readMenuWillEndDisplay:(CLReadMenu *)readMenu;
    
    /// 菜单完成隐藏
- (void)readMenuDidEndDisplay:(CLReadMenu *)readMenu;
    
    /// 点击返回
- (void)readMenuClickBack:(CLReadMenu *)readMenu;
    
    /// 点击书签
- (void)readMenuClickMark:(CLReadMenu *)readMenu topView:(CLRMTopView *)topView markButton:(UIButton *)markButton;
    
    /// 点击目录
- (void)readMenuClickCatalogue:(CLReadMenu *)readMenu;
    
    /// 点击切换日夜间
- (void)readMenuClickDayAndNight:(CLReadMenu *)readMenu;
    
    /// 点击上一章
- (void)readMenuClickPreviousChapter:(CLReadMenu *)readMenu;
    
    /// 点击下一章
- (void)readMenuClickNextChapter:(CLReadMenu *)readMenu;
    
    /// 拖拽章节进度(分页进度)
- (void)readMenuDraggingProgress:(CLReadMenu *)readMenu toPage:(NSInteger)page;
    
    /// 拖拽章节进度(总文章进度,网络文章也可以使用)
- (void)readMenuDraggingProgress:(CLReadMenu *)readMenu toChapterid:(NSString *)chapterid toPage:(NSInteger)page;
    
    /// 点击切换背景颜色
- (void)readMenuClickBGColor:(CLReadMenu *)readMenu;
    
    /// 点击切换字体
- (void)readMenuClickFont:(CLReadMenu *)readMenu;
    
    /// 点击切换字体大小
- (void)readMenuClickFontSize:(CLReadMenu *)readMenu;
    
    /// 切换进度显示(分页 || 总进度)
- (void)readMenuClickDisplayProgress:(CLReadMenu *)readMenu;
    
    /// 点击切换间距
- (void)readMenuClickSpacing:(CLReadMenu *)readMenu;
    
    /// 点击切换翻页效果
- (void)readMenuClickEffect:(CLReadMenu *)readMenu;

@end

@interface CLReadMenu : NSObject <UIGestureRecognizerDelegate>

/// 控制器
@property (nonatomic, weak) CLReadController *vc;

/// 阅读主视图
@property (nonatomic, weak) CLReadContentView *contentView;

/// 代理
@property (nonatomic, weak) id<CLReadMenuDelegate> delegate;

/// 菜单显示状态
@property (nonatomic) BOOL isMenuShow;

/// 单击手势
@property (nonatomic, strong) UITapGestureRecognizer *singleTap;

/// TopView
@property (nonatomic, strong) CLRMTopView *topView;

/// BottomView
@property (nonatomic, strong) CLRMBottomView *bottomView;

/// SettingView
@property (nonatomic, strong) CLRMSettingView *settingView;

/// 日夜间遮盖
@property (nonatomic, strong) UIView *cover;

- (instancetype)initWithVc:(CLReadController *)vc delegate:(id<CLReadMenuDelegate>)delegate;

/// TopView展示
- (void)showTopView:(BOOL)isShow completion:(__nullable VoidBlock)completion;
/// BottomView展示
- (void)showBottomView:(BOOL)isShow completion:(__nullable VoidBlock)completion;
/// SettingView展示
- (void)showSettingView:(BOOL)isShow completion:(__nullable VoidBlock)completion;

- (void)showMenu:(BOOL)isShow;
@end

NS_ASSUME_NONNULL_END
